package ClassWork.Work_01;

import java.util.Scanner;

public class Triangle {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("输入 x");
        int x = sc.nextInt();
        System.out.println("输入 y");
        int y = sc.nextInt();
        System.out.println("输入 z");
        int z = sc.nextInt();
        boolean flag = triangle(x,y,z);
        if(flag){
            System.out.println("能组成三角形！");
        }else{
            System.out.println("不能组成三角形！");
        }
    }
    public static boolean triangle(int x, int y, int z) {
        return x + y > z && x + z > y && y + z > x;
    }
}
